package com.wangxp.dao.user;

import com.wangxp.dao.BaseDao;
import com.wangxp.pojo.User;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UserDaoImpl implements UserDao {
    @Override
    public User getLoginUser(Connection con, String userCode) {
        PreparedStatement pre=null;
        ResultSet rs=null;
        User user=null;

        if(con!=null){
            String sql="select * from smbms_user where userCode=?";
            Object[] params={userCode};
            rs = BaseDao.execute(con, pre, rs, sql, params);
            try {
                if(rs.next()){
                  user=new User();
                  user.setId(rs.getInt("id"));

                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        return null;
    }
}
